#!/usr/bin/env python
#  -*- coding: utf-8 -*-
__author__ = 'yinq'

list_1 = [1, 3, 4, 5, 6, 7, 9, 7, 2]
list_1 = set(list_1)
list_2 = set([0, 2, 4, 6, 77, 99])
print(list_1, list_2)
# 交集
print(list_1.intersection(list_2))
# 并集
print(list_1.union(list_2))
# 差集  in list_1  but not in list_2
print(list_1.difference(list_2))
print(list_2.difference(list_1))
# 子集
list_3 = set([1, 2, 3, 4, 5, 6])
list_4 = set([2, 4, 6])
print(list_4.issubset(list_3))
print(list_3.issuperset(list_4))

# 对称差集  list_1 和list_2中重复的去掉
print(list_1.symmetric_difference(list_2))

print("------------------------")
